package levels;

import java.util.ArrayList;

import lobster.games.studios.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager.LayoutParams;
import android.widget.Button;
import android.widget.ImageView;

public class Level7 extends Activity {

	private Button buttonTop, buttonLeftMid, buttonMid, buttonRightMid, buttonRightRightMid, buttonBot;
	private int aux;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.level7);
		getWindow().addFlags(LayoutParams.FLAG_KEEP_SCREEN_ON);

		buttonTop = new Button(this);
		buttonLeftMid = new Button(this);
		buttonMid = new Button(this);
		buttonRightMid = new Button(this);
		buttonRightRightMid = new Button(this);
		buttonBot = new Button(this);

		buttonTop = (Button) findViewById(R.id.buttonTop);
		buttonLeftMid = (Button) findViewById(R.id.buttonLeftMid);
		buttonMid = (Button) findViewById(R.id.buttonMid);
		buttonRightMid = (Button) findViewById(R.id.buttonRightMid);
		buttonRightRightMid = (Button) findViewById(R.id.buttonRightRightMid);
		buttonBot = (Button) findViewById(R.id.buttonTop);

		buttonTop.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				changeValue((Button) v);
			}
		});
		buttonLeftMid.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				changeValue((Button) v);
			}
		});
		buttonMid.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				changeValue((Button) v);
			}
		});
		buttonRightMid.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				changeValue((Button) v);
			}
		});
		buttonRightRightMid.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				changeValue((Button) v);
			}
		});
		buttonBot.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				changeValue((Button) v);
			}
		});
	}


	public void changeValue(Button v) {
		aux = Integer.parseInt(v.getText().toString());
		if (aux == 6)
			aux = 1;
		else
			aux++;
		v.setText(aux);
	}
}
